<?php
namespace entity;

use my\bq\entity\EntityTemplate;
use entity\GoodsOfStyle;
use entity\Goods;
use entity\Style;
class GoodsOfStyle extends EntityTemplate{
	private $goods_id;
	private $style_id;
	private $goods;
	private $style;
	
	public function config(){
		$config = array();
		$config['name'] = 'ecm_goods_of_style';
		$config['alias'] = 'goods_of_style';
		$config['id'] = 'goods_id,style_id';
		$config['columns'] = array('goods_id','style_id');
		$config['relations'] = array();
		$config['relations'][0]= array('relation'=>'one-to-many','class'=>new Goods(),'name'=>'goods','key'=>'goods_id','column'=>'goods_id','lazy'=>true,'cascade'=>'update,delete,save');
		$config['relations'][1]= array('relation'=>'one-to-many','class'=>new Style(),'name'=>'style','key'=>'style_id','column'=>'style_id','lazy'=>true,'cascade'=>'update,delete,save');
		$this->config = $config;
	}
	
	public function __get($var){
		if(isset($this->$var)) {
			return $this->$var;
		}else{
			return parent::output($var);
		}
	}
	public function __set($var,$value){$this->$var = $value;}

}